package Demo1;

import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LianBao
 * Date: 2024-03-07
 * Time: 11:03
 */

interface IA {
    int A = 10;

    void FuncA(int a);
}

interface IB {
    void FuncB();
}

class Person {
    public String name;
    public int age;

    Person(String name, int age) {
        this.age = age;
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return age == person.age && Objects.equals(name, person.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age);
    }
}

public class Test1 {


    public static void main(String[] args) {
        Person person1 = new Person("zhangSan", 10);
        Person person2 = new Person("Lisi", 10);
        if (person1.equals(person2)) {
            System.out.println("True");
        }


    }

}
